import React, {Component} from 'react'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'

import Header from "../components/header";

import {loadActivityCenter} from "../redux/actions/findAction"
class ActivityCenterContainer extends Component {
  constructor (props){
   super(props)
   this.state= {}
}
componentWillMount(){
  const {dispatch} = this.props
  dispatch(loadActivityCenter())
}

   render() {
    // const {dispatch,match} = this.props
    console.log(this.props.find.get("activity"),"11");
    
    let activitylist = this.props.find.get("activity")
   return <div className="activity">
         <Header title="活动中心" {...this.props}></Header>

          <div className="activity-container">
            {
              activitylist.length !== 0 &&  
              activitylist.map((item,index)=>{
                return <div className="activitybody" key={index}>
                <img src={item.pmsSmallPic} alt=""/>
                <div className="activitytitle">
                  <h3><Link to="/">下载手机APP，注册即送彩金</Link></h3>
                  <span><Link to="/">点击查看</Link></span>
                </div>
              </div> 
              })
            }
          </div>
 
   </div>
   }
}

function mapStateToProps(state) {
  return {
    find: state.find
  }
}

export default connect(mapStateToProps)(ActivityCenterContainer)